﻿@model IEnumerable<DAL.Product>
@{
    ViewBag.Title = "ProductIndex";
}
<h2>
    数据读取速度：@ViewData["speed"]
</h2>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table border="1" width="100%" cellpadding="5" cellspacing="0">
    <tr>
        <th>
        </th>
        <th>
            ProductName
        </th>
        <th>
            Info
        </th>
        <th>
            CreateDate
        </th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ProductID }) |
                @Html.ActionLink("Details", "Details", new { id = item.ProductID }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ProductID })
            </td>
            <td>
                @item.ProductName
            </td>
            <td>
                @foreach (var i in item.ProductDetail)
                {
                    <div>@i.Info</div>
                }
            </td>
            <td>
                @String.Format("{0:g}", item.CreateDate)
            </td>
        </tr>
    }
</table>
